package com.koro.controller;

import com.koro.annotation.DataAccess;
import com.koro.dto.SaveOrdersDTO;
import com.koro.service.OrdersService;
import com.koro.vo.ResponseObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "订单管理")
@RequestMapping("/orders")
@RestController
public class OrdersController {

    @Autowired
    private OrdersService ordersService;

    @DataAccess
    @ApiOperation(value = "订单提交",notes = "订单提交")
    @PostMapping("/subOrders")
    public ResponseObject<Integer> subOrders(@RequestBody SaveOrdersDTO dto) {
        return ResponseObject.ok(ordersService.subOrders(dto));
    }

}
